<template>
	<div class="tpopinion">
		<div class="tpopinion-top">
			<textarea class="tpopinion-textarea" v-model="content" placeholder="请告诉我们您对住多多的意见和建议，200字以内。"></textarea>
		</div>

		<div class="tpopinion-center-title">
			联系方式
		</div>
		<div class="tpopinion-bottom">
			<textarea class="tpb-textarea" v-model="contactInformation" placeholder="您的手机、QQ或者Email等"></textarea>
		</div>

		<div class="tpopinion-btn" @click="GetOpinion">提交</div>
	</div>
</template>

<script>
	import { mapGetters, mapActions } from 'vuex'
	import api from '../fetch/api'
	export default {
		name: "tpopinion",
		data() {
			return {
				getHiss: JSON.parse(sessionStorage.getItem("userinfo")),
				content: '',
				contactInformation: '',
			}
		},
		mounted() {
		},
		computed: {
			...mapGetters([
				'source',
				'version',
			])
		},
		methods: {
			GetOpinion() {
				let ajaxSign = {
					content: this.content, //string 是 内容 内容
					source: this.source, // string 是 ios
					token: this.getHiss.token, // string 是 4 fd3d9038675f82f376477fa23a40594
					contactInformation: this.contactInformation // string 是 联系方式
				}
				let ajaxData = api.getAES(ajaxSign);
				api.GetOpinion(ajaxData)
				.then(res => {
					this.$dialog.toast({
						mes: res.msg,
						timeout: 1000
					});
					if(res.sta == 200) {
						this.$router.go(-1)
					}
				})
			}
		}
	}
</script>

<style scoped>
	html,
	body {
		overflow: hidden;
	}
	
	.tpopinion {
		width: 100%;
		height: 100%;
		position: fixed;
		padding: 0 .24rem;
		box-sizing: border-box;
		background: #fff;
	}
	
	.tpopinion .tpopinion-top {
		width: 100%;
	}
	
	.tpopinion .tpopinion-textarea {
		display: block;
		width: 100%;
		height: 4.41rem;
		border-radius: .07rem;
		padding: .2rem;
		box-sizing: border-box;
	}
	
	.tpopinion-center-title {
		color: #282828;
		font-size: .35rem;
		line-height: .35rem;
		padding: .24rem 0 .4rem 0;
		box-sizing: border-box;
	}
	
	.tpopinion .tpb-textarea {
		display: block;
		width: 100%;
		height: 1.32rem;
		border-radius: .07rem;
		padding: .2rem;
		box-sizing: border-box;
	}
	
	.tpopinion-btn {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		font-size: .31rem;
		color: #a4a4a4;
		padding: .24rem 0;
		box-sizing: border-box;
		text-align: center;
		background: rgba(0, 0, 0, 0.05);
	}
	
	::-webkit-input-placeholder {
		font-size: .28rem;
		color: #a4a4a4;
	}
</style>